﻿using System;

class NKFacturiel
{
    static void Main()
    {
        //Exercise 4.
        //Write a program that calculates N!/K! for given N and K (1<K<N).

        // Nakov's book: Multiply the numbers from K+1 to N.

        Console.Write("Enter K (1<K<N):  ");
        decimal k = decimal.Parse(Console.ReadLine());
        Console.Write("Enter N (1<K<N):  ");
        decimal n = decimal.Parse(Console.ReadLine());
        decimal result = 1;
        if (1 < k && k < n)
        {
            for (decimal i = k + 1; i <= n; i++)
            {
                result *= i;    //result = result * i;
            }
            Console.WriteLine();
            Console.WriteLine("N!/K! is:  {0} ", result);            
        }
        else
        {
            Console.WriteLine();
            Console.WriteLine("The numbers K and N should meet the following prerequisite: 1 < K < N.");
        }
        Console.WriteLine();
    }
}

